package com.wty.gw.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wty.gw.util.PageParamReq;
import com.wty.gw.dao.CommonInfoMapper;
import com.wty.gw.model.Do.CommonInfoDO;
import com.wty.gw.model.query.CommonInfoQuery;
import com.wty.gw.service.CommonInfoService;
import com.wty.gw.model.vo.CommonInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class CommonInfoServiceImpl implements CommonInfoService{

	@Autowired
    private CommonInfoMapper commonInfoMapper;

    @Override
    public void add(CommonInfoDO commonInfoDo) {
        commonInfoMapper.insert(commonInfoDo);
    }

    @Override
    public void delete(Long id) {
        commonInfoMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void update(CommonInfoDO commonInfoDo) {
        commonInfoMapper.updateByPrimaryKeySelective(commonInfoDo);
    }

    @Override
    public PageInfo<CommonInfoVo> listByPage(CommonInfoQuery commonInfoQuery) {
        PageHelper.startPage(commonInfoQuery.getPageNo(), commonInfoQuery.getPageSize());

        return new PageInfo(commonInfoMapper.listBycompanyId(commonInfoQuery));
    }

    @Override
    public CommonInfoDO get(Long id) {
        return commonInfoMapper.selectByPrimaryKey(id);
    }
	
	
	
	
	
	
}